//定义组件
define(function(require, exports, module) {

    var sTpl = require('components/multi-page/index.html');
    var css = require('components/multi-page/index.css');

    var myMixin = require('modules/mixins.js');

    var vueComponent = Vue.extend({
        template: sTpl,
        mixins: [myMixin],

        data: function() {
            return {
                pageList: [{
                    menuName: '组件管理',
                    url: 'http://www.baidu.com',
                    active: true
                }, {
                    menuName: '办公界面',
                    url: 'http://www.hao123.com',
                    active: false
                }, {
                    menuName: '一企一档',
                    url: 'http://www.csdn.com',
                    active: false
                }, {
                    menuName: '环境 质量',
                    url: 'http://www.yhd.com/',
                    active: false
                }, {
                    menuName: '错误页面',
                    url: 'http://www.ly.com',
                    active: false
                }]
            }
        },
        methods: {
            activePage(index) {
                _.forEach(this.pageList, function(val, key) {
                    if (key == index) {
                        val.active = true;
                    } else if (val.active == true) {
                        val.active = false
                    }
                })
            }
        }
    });

    Vue.component('m-multi-page', vueComponent); //都全局注册 同时exports
    module.exports = vueComponent;
});